package com.gifts.ui.page.selectaProduct;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.plaf.basic.BasicInternalFrameTitlePane.MaximizeAction;
/**
 * UI class Filtering price
 * 
 * @author kevin
 *
 */
public class JFilterPricePanel  extends JPanel {
	
	private JTextField minTextField;
	private JTextField maxTextField;
	private JLabel toLabel;
	private JButton submitButton;
	
	private JLabel errorMessage;
	
	private JButton showMoreButton;
	
	private JButton clearButton;
	public JFilterPricePanel() {
		JLabel minPrice = new JLabel("Min $");
		JLabel maxPrice = new JLabel("Max $");
		minTextField = new JTextField(5);
		errorMessage = new JLabel();
		errorMessage.setForeground(Color.RED);
		maxTextField = new JTextField(5);
		
		toLabel =  new JLabel("to");
		
		
		//searchBoxTextField.setSize(600, 100);
		submitButton = new JButton("Filter");
		clearButton = new JButton("Clear");
		showMoreButton = new JButton("Show More");
		
		FlowLayout leftLayout = new FlowLayout();
		leftLayout.setAlignment(FlowLayout.LEFT);
		
		JPanel leftPanel = new JPanel();
		leftPanel.setLayout(leftLayout);
		leftPanel.add(minPrice);
		leftPanel.add(minTextField);
		leftPanel.add(toLabel);
		leftPanel.add(maxPrice);
		leftPanel.add(maxTextField);
		leftPanel.add(submitButton);
		
		leftPanel.add(errorMessage);
		
		JPanel rightPanel = new JPanel();
		rightPanel.add(showMoreButton);
		
		FlowLayout rightLayout = new FlowLayout();
		rightLayout.setAlignment(FlowLayout.RIGHT);
		
		setLayout(new BorderLayout());
		add(leftPanel,BorderLayout.WEST);
		add(rightPanel,BorderLayout.EAST);
	}
	
	public JTextField getSearchBoxTextField() {
		return minTextField;
	}
	
	public JButton getSubmitButton() {
		return submitButton;
	}
	
	
	public JButton getShowMoreButton() {
		return showMoreButton;
	}
	
	public JLabel getErrorMessageLabel() {
		return errorMessage;
	}
	
	public JTextField getMinJTextField() {
		return minTextField;
	}
	
	public JTextField getMaxJTextField() {
		
		return maxTextField;
	}

}
